package com.example.swaggerproject.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "图书信息", example = "{\"id\":1,\"name\":\"SpringBoot\",\"price\":88.8}")
public class Book {

    @NotNull
    @Schema(description = "图书ID", example = "1")
    private Long id;

    @Schema(description = "图书名称", example = "SpringBoot")
    private String name;

    @Min(18)
    @Max(188)
    @Schema(description = "图书价格", example = "88.8", type = "Double")
    private Double price;

}
